<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>添加套装</title>
</head>
<body>

<form class="layui-form" lay-filter="layui-form">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
                <div class="layui-form-item">
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>套装名称</label>
                    <div class="layui-input-block">
                        <input type="text"  name="name" lay-verify="required" autocomplete="off" placeholder="请输入套装名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" title="两件套属性"><text title="必填项" style="color:red;">*</text>两件套属性</label>
                    <div class="layui-input-block">
                        <textarea name="attr1" id="attr1" lay-verify="required" placeholder="请输入两件套属性" class="layui-textarea" lay-verify=""></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" title="四件套属性"><text title="必填项" style="color:red;">*</text>四件套属性</label>
                    <div class="layui-input-block">
                        <textarea name="attr2" id="attr2" lay-verify="required" placeholder="请输入四件套属性" class="layui-textarea" lay-verify=""></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" title="六件套属性"><text title="必填项" style="color:red;">*</text>六件套属性</label>
                    <div class="layui-input-block">
                        <textarea name="attr3" id="attr3" lay-verify="required" placeholder="请输入六件套属性" class="layui-textarea" lay-verify=""></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">项链</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="kind7"
                             data-sourceType="route"
                             data-source="/admin.ah.AuxiliaryEquipment/index"
                             data-params='{"search_param":{"kind":{"value":"7","condition":"="},"coordinate_id":{"value":"","condition":"SPECIAL"}}}'
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">戒指</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="kind81"
                             data-sourceType="route"
                             data-source="/admin.ah.AuxiliaryEquipment/index"
                             data-params='{"search_param":{"kind":{"value":"8","condition":"="},"coordinate_id":{"value":"","condition":"SPECIAL"}}}'
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">戒指</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="kind82"
                             data-sourceType="route"
                             data-source="/admin.ah.AuxiliaryEquipment/index"
                             data-params='{"search_param":{"kind":{"value":"8","condition":"="},"coordinate_id":{"value":"","condition":"SPECIAL"}}}'
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">手套</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="kind9"
                             data-sourceType="route"
                             data-source="/admin.ah.AuxiliaryEquipment/index"
                             data-params='{"search_param":{"kind":{"value":"9","condition":"="},"coordinate_id":{"value":"","condition":"SPECIAL"}}}'
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">腰带</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="kind10"
                             data-sourceType="route"
                             data-source="/admin.ah.AuxiliaryEquipment/index"
                             data-params='{"search_param":{"kind":{"value":"10","condition":"="},"coordinate_id":{"value":"","condition":"SPECIAL"}}}'
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">靴子</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="kind11"
                             data-sourceType="route"
                             data-source="/admin.ah.AuxiliaryEquipment/index"
                             data-params='{"search_param":{"kind":{"value":"11","condition":"="},"coordinate_id":{"value":"","condition":"SPECIAL"}}}'
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="laytp-btn laytp-btn-primary laytp-btn-sm" lay-submit="" lay-filter="add">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="laytp-btn laytp-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script>
    if(localStorage.getItem("staticDomain")){
        document.write("<link rel='stylesheet' href='" + localStorage.getItem("staticDomain") + "/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/layui/layui.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/laytp/layuiConfig.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/jquery_3.3.1.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/jquery.tablednd.js?v="+localStorage.getItem("version")+"'><\/script>");
    }else{
        document.write("<link rel='stylesheet' href='/static/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='/static/component/layui/layui.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='/static/component/laytp/layuiConfig.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='/static/component/jquery_3.3.1.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='/static/component/jquery.tablednd.js?v="+localStorage.getItem("version")+"'><\/script>");
    }
</script>
<script>
    layui.use(['laytp'],function(){
        let $ = layui.jquery;

        layui.form.on('submit(add)', function(data){
            var btnAnim = layui.button.load({elem:$(this)});
            facade.ajax({
                route:'/admin.ah.Coordinate/add',
                data : data.field
            }).done(function(res){
                if(res.code === 0){
                    parent.layui.layer.close(parent.layui.layer.getFrameIndex(window.name));//关闭当前页
                    parent.layui.table.reload("laytp-table");
                }
                btnAnim.stop();
            }).fail(function(){
                btnAnim.stop();
            });
            return false;
        });
    })
</script>
</body>
</html>